#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "trajectorycapture.h"

class QLabel;
class QGridLayout;
class QImage;
class QWidget;
class QTimer;
class StaticGestureDialog;

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
	void close();
	void about();
	void startTracking();
	void stopTracking();
	void showSettings();
	void updateLabels();
	void editTracks();
	void open();
	void save();
	void saveAs();
	void newFile();
	void showStatics();
	void closeStatics();
	void captureStatic();
	void hmm();
	void trainStatic();

private:
	Ui::MainWindow *ui_;
	TrajectoryCapture *trajectory_;
	vector<mlgesture::Trajectory> trajectories_;
	StaticGestureDialog *staticWindow_;
	QString fileSave_;
	bool saved_;

	int camId_;
	int lowerSkinThreshold_;
	int upperSkinThreshold_;
	double trackingSensity_;
	int lowerValueThreshold_;
	int upperValueThreshold_;
	bool adaptThresholdActive_;

	QTimer *frameTimer_;
	QTimer *trackingTimer_;

	QAction *closeAct_;
	QAction *startAct_;
	QAction *settingsAct_;
	QAction *aboutAct_;
	QAction *stopAct_;
	QAction *editAct_;
	QAction *openAct_;
	QAction *saveAct_;
	QAction *saveAsAct_;
	QAction *newAct_;
	QAction *staticAct_;
	QAction *captureAct_;
	QAction *hmmAct_;
	QAction *trainStaticAct_;

	QMenu *fileMenu_;
	QMenu *actionMenu_;
	QMenu *helpMenu_;

	QWidget *mainWidget_;
	QGridLayout *layout_;
	QLabel *imgLabels_[2][2];

	void createLayout();
	void createActions();
	void createMenu();
};

#endif // MAINWINDOW_H
